﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 角色性别管理
/// </summary>
public class GenderManager : MonoBehaviour
{
    [Header("女角色物品")]
    public List<GameObject> femanlItems;
    [Header("男角色物品")]
    public List<GameObject> maleItems;

    private void Start()
    {
        ShowCharacterModel();
    }

    // 显示角色
    public void ShowCharacterModel()
    {
        // 女角色
        if (PlayerPrefs.GetInt("Gender", 0) == 0)
        {
            for (int i = 0; i < maleItems.Count; i++)
                maleItems[i].SetActive(false);
            for (int i = 0; i < femanlItems.Count; i++)
                femanlItems[i].SetActive(true);
        }
        // 男角色
        else
        {
            for (int i = 0; i < femanlItems.Count; i++)
                femanlItems[i].SetActive(false);
            for (int i = 0; i < maleItems.Count; i++)
                maleItems[i].SetActive(true);
        }
    }
}
